package com.thread.test13;

import java.util.Random;

/**
 * @author bin
 * @date 2025 - 03 -14
 **/
public class Fruit {
    private String[] fruitArray = {"苹果","香蕉","橘子","西瓜","葡萄"};

    private int index;

    public Fruit(){
        this.index = new Random().nextInt(fruitArray.length);
    }

    @Override
    public String toString() {
        return fruitArray[index];
    }
}
